<?php
require "model/message.model.php";
session_start();
if(isset($_SESSION['username'])){
header("content-type:text/html;charset=utf-8");
$id = $_GET["id"];
$tr = messageList::delemessage($id);
if($tr){
    echo "<script>alert('删除成功');parent.location.href='message.php';</script>";
}else{
    echo "<script>alert('删除失败');parent.location.href='message.php';</script>";
}
}else{
  header("Location:./login.php");
  exit();
}